<?php
// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | create by allen.qiang
// +----------------------------------------------------------------------


/**
 * 抽奖记录操作功能
 * @package  htdocs
 * @subpackage  quanliadmin
 * @create by allen.qiang
 */

quanli_require('module/base/promotionHandler.class.php');

class pa_drawRecord {

    public function execute() {

        if (isset($_REQUEST['operFlg']) && is_numeric($_REQUEST['operFlg'])) {

            switch ($_REQUEST['operFlg']) {

                case 1: //抽奖记录列表信息
                    $this-> drawRecordList();
                    break;

                default:
                    $this->toError('参数错误');
                    break;
            }

        } else {

            $this->toError('参数错误');

        }




    }

    private function toError( $msg ) {

        global $G_PGLOB;

        $G_PGLOB->display_error_page( $msg );

    }

    /**
     * 优惠券列表信息
     */
    private function drawRecordList() {

        global $G_PGLOB;

        $promotionID = $_REQUEST['promotionID'];

        //得到促销活动类型
        $promotionHandler = new promotionHandler($G_PGLOB->DBCA);

        $arg_array['promotionID'] = $promotionID;

        $promotion_weixin = $promotionHandler->searchWxActivity($arg_array);

        $G_PGLOB->smarty->assign('promotionTypeName',$promotion_weixin[0]['promotionTypeName']);

        $G_PGLOB->smarty->assign('promotionID',$promotionID);

        $G_PGLOB->smarty->display('promotion/drawRecordList.tpl');

    }

}